#define _CRT_SECURE_NO_WARNINGS 1
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include<math.h>
#include<stdlib.h>
#include<stdio.h>
using namespace std;

void sort(char a[110][60], int size, int start)
{
    for (int i = start; i < size; i++)
    {
        for (int j = start; j < start + size - 1 - i; j++)
        {
            char temp[60] = { 0 };
            if (strcmp(a[j], a[j + 1]) > 0)
            {
                strcat(temp, a[j + 1]);
                memset(a[j + 1], 0, 60);
                strcat(a[j + 1], a[j]);
                memset(a[j], 0, 60);
                strcat(a[j], temp);
            }
        }
    }
    return;
}
int main()
{
    char word[110][60] = { 0 }, targetword[110][60] = { 0 }, temp = 0, SortWord[110][60] = { 0 };
    int l1 = 0, l2 = 0, flag = 1, l3 = 0;
    for (int i = 0; temp != '\n'; i++)
    {
        scanf("%s%c", word[l1++], &temp);
    }
    for (int i = 0; i < l1; i++)
    {
        flag = 1;
        for (int j = 0; j < l2; j++)
        {
            if (strcmp(word[i], targetword[j]) == 0)
            {
                flag = 0;
                break;
            }
        }
        if (flag == 0)
            continue;
        else
        {
            strcat(targetword[l2++], word[i]);
        }
    }
    sort(targetword, l2, 0);
    for (int i = 0; i < l2; i++)
        printf("%s\n", targetword[i]);
    return 0;
}